<h1> Problem Format </h1>

The current documents describes the core problem format for the system. <b>The version of the format described here is 1.</b>
<br/> <br/>
Every problem should be in a separate directory with a name matching the pattern <code>[a-z0-9][a-z0-9_-]*</code>. The directory name serves as an identifier for the problem. 
<br/> <br/>
The problem directory should contain the following files (all the files listed below are mandatory for the problem to be valid, unless stated as optional): 
<ul>
 <li> A JSON object, describing the problem metadata, in a file called <code>problem.json</code>. The file should use UTF-8 encoding
 <li> An arbitrary number of files (but at least one) with names matching the pattern <code>description*</code> (e.g. <code>description.pdf</code>). Those serve as description files for the problem
 <li> 
	<ol>
		<li> For problems with one test, a file named <code>test.in</code> - the test input file, and a corresponding <code>test.ans</code> - the test answer file
		<li> For multi-test problems, files named <code>test.00.in</code>, <code>test.01.in</code>, etc - test input files, and <code>test.00.ans</code>, <code>test.01.ans</code>, etc - respectively test answer files
		<ul> <li> <b>Note: test pairs should have consecutive numbers, starting from 00, with no numbers skipped</b> </ul>
	</ol>
 <li> (optional) Source file with a name matching <code>checker*</code> - a checker for the problem. The checker should accept 3 command line parameters - <code>&lt;input_file&gt;, &lt;answer_file&gt;, &lt;output_file&gt;</code>, which are respectively the test input file, test answer file and the contestant output file
 <li> (optional) Any number of files named <code>solution*</code> (e.g. <code>solution_manev.cpp</code>) - author solutions for the problem
 <li> (optional) A subdirectory named <code>_public_files</code>, containing public additional resources for the problem
 <li> (optional, private <code>*</code>) A subdirectory named <code>_files</code>, containing private additional resources for the problem
 <br/> <br/>
</ul>
The JSON object describing the problem metadata in `problem.json` should have the following properties:
<ul>
 <li> <code>"format"</code> : string of the type <code>"core-problem-N"</code>, where N is an integer denoting the version of the problem format used
 <li> <code>"title"</code> : string, problem title
 <li> <code>"about"</code> : (optional) string, containing additional info about the problem
 <li> <code>"time_limit"</code> : (private) floating-point number, denotes the time limit of the problem, in seconds
 <li> <code>"memory_limit"</code> : (optional, private) integer, denotes the memory limit of the problem, in mebibytes (2^20 bytes)
 <li> <code>"origin"</code> : (optional, private) string, containing info about the origin
 <li> <code>"notes"</code> : (optional, private) string, additional notes about the problem
 <li> <code>"authors"</code>: (optional, private) An array of strings, listing problem authors
 <li> <code>"test_weights"</code>: (optional, private) An array of integers, denoting what is the relative weight of each test (if applicable)
 <li> <code>"checker"</code>: string, either <code>"diff"</code> or <code>"custom"</code>. <code>"diff"</code> means that the contestant output for each test should be compared directly to the answer file, and <code>"custom"</code> means that a checker should be used
</ul>
<br/>
<i>`*` <b>private</b> means that these properties aren't visible for all users unless permissions are given</i>
<br/> <br/>
Example:
<br/>
<br/>
<code>
{ <br/>
 "format": "core-problem-1", <br/>
 "title": "hw1-problem-A", <br/>
 "time_limit": 4.5, <br/>
 "memory_limit": 20, <br/>
 "origin": "Taken from Contest-X", <br/>
 "notes": "DP", <br/>
 "authors":["author1", "author2"], <br/>
 "checker": "diff" <br/>
} <br/>
</code>
<br/>
<h3> Additional notes:</h3>
<ul>
 <li> If there is only one test file and <code>"test_weights"</code> is present in the metadata object, it is ignored.
 <li> If there are multiple tests, the number of elements in <code>"test_weights"</code> must be equal to the test files count
 <li> If <code>"checker"</code> is <code>"custom"</code> in the metadata object, there must be a checker source file in the problem folder
</ul>
<br/> <br />
<h3> Problem Format Validation Schema: </h3>
<code>
<br/>
{<br/>
	"name": "problem",<br/>
    "properties": {<br/>
        "format": {<br/>
            "type": "string",<br/>
            "description": "core-problem-N",<br/>
            "pattern": "core-problem-\\d*",<br/>
            "optional": false<br/>
        },<br/>
        "title": {<br/>
            "type": "string",<br/>
            "description": "Title of the problem",<br/>
            "optional": false<br/>
        },<br/>
        "about": {<br/>
            "type": "string",<br/>
            "description": "Additional info about the problem",<br/>
            "optional": true<br/>
        },<br/>
        "time_limit": {<br/>
            "type": "number",<br/>
            "description": "Denotes the time limit of the problem in seconds",<br/>
            "optional": false,<br/>
            "minimum": 0<br/>
        },<br/>
        "memory_limit": {<br/>
            "type": "integer",<br/>
            "description": "Denotes the memory limit of the problem, in mebibytes (2^20 bytes)",<br/>
            "optional": true,<br/>
            "minimum": 0<br/>
        },<br/>
        "origin": {<br/>
            "type": "string",<br/>
            "description": "Info about the origin",<br/>
            "optional": true<br/>
        },<br/>
        "notes": {<br/>
            "type": "string",<br/>
            "description": "Additional notes about the problem",<br/>
            "optional": true<br/>
        },<br/>
        "authors": {<br/>
            "type": "array",<br/>
            "items": {<br/>
                "type": "string"<br/>
            },<br/>
            "description": "An array of strings, listing problem authors",<br/>
            "optional": true<br/>
        },<br/>
        "test_weights": {<br/>
            "type": "array",<br/>
            "items": {<br/>
                "type": "integer"<br/>
            },<br/>
            "description": " An array of integers, denoting what the relative weight of each test is",<br/>
            "optional": true<br/>
        },<br/>
        "checker": {<br/>
            "type": "string",<br/>
            "enum": [<br/>
                "diff",<br/>
                "custom"<br/>
            ],<br/>
            "optional": false<br/>
        }<br/>
    }<br/>
}<br/>
</code>